////
//// Source code recreated from a .class file by IntelliJ IDEA
//// (powered by Fernflower decompiler)
////
//package video;
//
//import javax.microedition.lcdui.ChoiceGroup;
//import javax.microedition.lcdui.Command;
//import javax.microedition.lcdui.CommandListener;
//import javax.microedition.lcdui.Display;
//import javax.microedition.lcdui.Displayable;
//import javax.microedition.lcdui.Form;
//import javax.microedition.lcdui.Image;
//import javax.microedition.lcdui.Item;
//import javax.microedition.lcdui.ItemStateListener;
//import javax.microedition.lcdui.TextField;
//
//public class SettingForm extends Form implements CommandListener, ItemStateListener {
//    private int nIndex = 0;
//    private final AboutCanvas parentCanvas;
//    private final Display display;
//    private final ListForm parentlistform;
//    private Command okCommand = null;
//    private Command backCommand = null;
//    public String SvrAddr = "127.0.0.1";
//    public int SvrPort = 9101;
//    public String User = "abc";
//    public String Pswd = "123";
//    public boolean IsSv = true;
//    public int Chnl = 1;
//    public boolean Flsh = false;
//    public String ystno = "A0";
//    private ChoiceGroup cgtype = null;
//    public boolean useystno = true;
//    public boolean IsYST = true;
//    public String Group = "A";
//    public int Ystno = 0;
//    public String[] strMSG = new String[20];
//    public String strName = "0";
//
//    public SettingForm(AboutCanvas var1, Display var2, ListForm var3, int var4) {
//        super(var1.strSet);
//        this.parentCanvas = var1;
//        this.display = var2;
//        this.parentlistform = var3;
//        this.nIndex = var4;
//        if(this.parentCanvas.nLanguage == 0) {
//            this.strMSG[0] = "连接方式:";
//            this.strMSG[1] = "确定";
//            this.strMSG[2] = "取消";
//            this.strMSG[3] = "使用云视通";
//            this.strMSG[4] = "使用IP";
//            this.strMSG[5] = "云视通号码";
//            this.strMSG[6] = "目的IP地址";
//            this.strMSG[7] = "目的端口";
//            this.strMSG[8] = "通道号";
//            this.strMSG[9] = "用户名";
//            this.strMSG[10] = "密码";
//            this.strMSG[11] = "保存密码";
//            this.strMSG[12] = "背景灯";
//            this.strMSG[13] = "视频源名称";
//        } else {
//            this.strMSG[0] = "Connect Type:";
//            this.strMSG[1] = "OK";
//            this.strMSG[2] = "Cancel";
//            this.strMSG[3] = "Use CloudSEE";
//            this.strMSG[4] = "Use IP and Port";
//            this.strMSG[5] = "CloudSEE ID";
//            this.strMSG[6] = "Source Address";
//            this.strMSG[7] = "Port";
//            this.strMSG[8] = "Channel";
//            this.strMSG[9] = "User";
//            this.strMSG[10] = "Password";
//            this.strMSG[11] = "Sava Password";
//            this.strMSG[12] = "Back Light";
//            this.strMSG[13] = "Video Source Name";
//        }
//
//        this.cgtype = new ChoiceGroup(this.strMSG[0], 1);
//        this.okCommand = new Command(this.strMSG[1], 4, 1);
//        this.backCommand = new Command(this.strMSG[2], 2, 1);
//        this.addCommand(this.okCommand);
//        this.addCommand(this.backCommand);
//        this.setCommandListener(this);
//        this.setItemStateListener(this);
//        this.loadchannelinfo();
//        TextField var5 = new TextField(this.strMSG[13], this.strName, 256, 0);
//        this.append(var5);
//        if(16 > var5.getPreferredHeight()) {
//            var5.setPreferredSize(var5.getPreferredWidth(), 16);
//        }
//
//        this.cgtype.append(this.strMSG[3], (Image)null);
//        this.cgtype.append(this.strMSG[4], (Image)null);
//        this.append(this.cgtype);
//        if(this.IsYST) {
//            this.cgtype.setSelectedIndex(0, true);
//        } else {
//            this.cgtype.setSelectedIndex(1, true);
//        }
//
//        if(this.cgtype.getSelectedIndex() == 0) {
//            var5 = new TextField(this.strMSG[5], this.ystno, 256, 0);
//            this.append(var5);
//            if(16 > var5.getPreferredHeight()) {
//                var5.setPreferredSize(var5.getPreferredWidth(), 16);
//            }
//        } else {
//            var5 = new TextField(this.strMSG[6], this.SvrAddr, 256, 4);
//            this.append(var5);
//            if(16 > var5.getPreferredHeight()) {
//                var5.setPreferredSize(var5.getPreferredWidth(), 16);
//            }
//
//            var5 = new TextField(this.strMSG[7], String.valueOf(this.SvrPort), 5, 2);
//            this.append(var5);
//            if(16 > var5.getPreferredHeight()) {
//                var5.setPreferredSize(var5.getPreferredWidth(), 16);
//            }
//        }
//
//        var5 = new TextField(this.strMSG[8], String.valueOf(this.Chnl), 2, 2);
//        this.append(var5);
//        if(16 > var5.getPreferredHeight()) {
//            var5.setPreferredSize(var5.getPreferredWidth(), 16);
//        }
//
//        var5 = new TextField(this.strMSG[9], this.User, 256, 0);
//        this.append(var5);
//        if(16 > var5.getPreferredHeight()) {
//            var5.setPreferredSize(var5.getPreferredWidth(), 16);
//        }
//
//        var5 = new TextField(this.strMSG[10], this.Pswd, 256, 65536);
//        this.append(var5);
//        if(16 > var5.getPreferredHeight()) {
//            var5.setPreferredSize(var5.getPreferredWidth(), 16);
//        }
//
//        ChoiceGroup var6 = new ChoiceGroup((String)null, 2);
//        var6.append(this.strMSG[11], (Image)null);
//        var6.setSelectedIndex(0, this.IsSv);
//        this.append(var6);
//        var6 = new ChoiceGroup((String)null, 2);
//        var6.append(this.strMSG[12], (Image)null);
//        var6.setSelectedIndex(0, this.Flsh);
//        this.append(var6);
//    }
//
//    public void itemStateChanged(Item var1) {
//        String var2 = var1.getLabel();
//        if(var2 != null && var2.equals(this.strMSG[0])) {
//            TextField var3;
//            ChoiceGroup var4;
//            if(this.cgtype.getSelectedIndex() == 0) {
//                this.deleteAll();
//                var3 = new TextField(this.strMSG[13], this.strName, 256, 0);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                this.append(this.cgtype);
//                var3 = new TextField(this.strMSG[5], this.ystno, 256, 0);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[8], String.valueOf(this.Chnl), 2, 2);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[9], this.User, 256, 0);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[10], this.Pswd, 256, 65536);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var4 = new ChoiceGroup((String)null, 2);
//                var4.append(this.strMSG[11], (Image)null);
//                var4.setSelectedIndex(0, this.IsSv);
//                this.append(var4);
//                var4 = new ChoiceGroup((String)null, 2);
//                var4.append(this.strMSG[12], (Image)null);
//                var4.setSelectedIndex(0, this.Flsh);
//                this.append(var4);
//            } else {
//                this.deleteAll();
//                var3 = new TextField(this.strMSG[13], this.strName, 256, 0);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                this.append(this.cgtype);
//                this.cgtype.setSelectedIndex(1, true);
//                var3 = new TextField(this.strMSG[6], this.SvrAddr, 256, 4);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[7], String.valueOf(this.SvrPort), 5, 2);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[8], String.valueOf(this.Chnl), 2, 2);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[9], this.User, 256, 0);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var3 = new TextField(this.strMSG[10], this.Pswd, 256, 65536);
//                this.append(var3);
//                if(16 > var3.getPreferredHeight()) {
//                    var3.setPreferredSize(var3.getPreferredWidth(), 16);
//                }
//
//                var4 = new ChoiceGroup((String)null, 2);
//                var4.append(this.strMSG[11], (Image)null);
//                var4.setSelectedIndex(0, this.IsSv);
//                this.append(var4);
//                var4 = new ChoiceGroup((String)null, 2);
//                var4.append(this.strMSG[12], (Image)null);
//                var4.setSelectedIndex(0, this.Flsh);
//                this.append(var4);
//            }
//        }
//
//    }
//
//    public void commandAction(Command var1, Displayable var2) {
//        this.strName = ((TextField)this.get(0)).getString();
//        if(this.cgtype.getSelectedIndex() == 0) {
//            this.ystno = ((TextField)this.get(2)).getString();
//            this.Chnl = Integer.parseInt(((TextField)this.get(3)).getString());
//            this.User = ((TextField)this.get(4)).getString();
//            this.Pswd = ((TextField)this.get(5)).getString();
//            this.IsSv = ((ChoiceGroup)this.get(6)).isSelected(0);
//            this.Flsh = ((ChoiceGroup)this.get(7)).isSelected(0);
//        } else {
//            this.SvrAddr = ((TextField)this.get(2)).getString();
//            this.SvrPort = Integer.parseInt(((TextField)this.get(3)).getString());
//            this.Chnl = Integer.parseInt(((TextField)this.get(4)).getString());
//            this.User = ((TextField)this.get(5)).getString();
//            this.Pswd = ((TextField)this.get(6)).getString();
//            this.IsSv = ((ChoiceGroup)this.get(7)).isSelected(0);
//            this.Flsh = ((ChoiceGroup)this.get(8)).isSelected(0);
//        }
//
//        if(var1 == this.okCommand) {
//            if(this.cgtype.getSelectedIndex() != 0) {
//                this.IsYST = false;
//            } else {
//                this.IsYST = true;
//                if(this.ystno.length() > 0) {
//                    int var3 = 0;
//                    byte[] var4 = new byte[this.ystno.length()];
//                    var4 = this.ystno.getBytes();
//
//                    for(int var5 = 0; var5 < this.ystno.length(); ++var5) {
//                        if(var4[var5] >= 65 && var4[var5] <= 122) {
//                            var3 = var5;
//                        }
//                    }
//
//                    try {
//                        this.Ystno = Integer.parseInt(this.ystno.substring(var3 + 1));
//                        this.Group = this.ystno.substring(0, var3 + 1);
//                    } catch (Exception var6) {
//                        ;
//                    }
//                }
//            }
//
//            this.savechannelinfo();
//            this.parentlistform.refreshlst(this.nIndex);
//        }
//
//        this.display.setCurrent(this.parentlistform);
//    }
//
//    public void loadchannelinfo() {
//        this.strName = this.parentlistform.channelinfo[this.nIndex].strName;
//        this.SvrAddr = this.parentlistform.channelinfo[this.nIndex].SvrAddr;
//        this.SvrPort = this.parentlistform.channelinfo[this.nIndex].SvrPort;
//        this.User = this.parentlistform.channelinfo[this.nIndex].User;
//        this.Pswd = this.parentlistform.channelinfo[this.nIndex].Pswd;
//        this.IsSv = this.parentlistform.channelinfo[this.nIndex].IsSv;
//        this.Chnl = this.parentlistform.channelinfo[this.nIndex].Chnl;
//        this.Flsh = this.parentlistform.channelinfo[this.nIndex].Flsh;
//        this.ystno = this.parentlistform.channelinfo[this.nIndex].ystno;
//        this.useystno = this.parentlistform.channelinfo[this.nIndex].useystno;
//        this.IsYST = this.parentlistform.channelinfo[this.nIndex].IsYST;
//        this.Group = this.parentlistform.channelinfo[this.nIndex].Group;
//        this.Ystno = this.parentlistform.channelinfo[this.nIndex].Ystno;
//    }
//
//    public void savechannelinfo() {
//        this.parentlistform.channelinfo[this.nIndex].strName = this.strName;
//        this.parentlistform.channelinfo[this.nIndex].SvrAddr = this.SvrAddr;
//        this.parentlistform.channelinfo[this.nIndex].SvrPort = this.SvrPort;
//        this.parentlistform.channelinfo[this.nIndex].User = this.User;
//        this.parentlistform.channelinfo[this.nIndex].Pswd = this.Pswd;
//        this.parentlistform.channelinfo[this.nIndex].IsSv = this.IsSv;
//        this.parentlistform.channelinfo[this.nIndex].Chnl = this.Chnl;
//        this.parentlistform.channelinfo[this.nIndex].Flsh = this.Flsh;
//        this.parentlistform.channelinfo[this.nIndex].ystno = this.ystno;
//        this.parentlistform.channelinfo[this.nIndex].useystno = this.useystno;
//        this.parentlistform.channelinfo[this.nIndex].IsYST = this.IsYST;
//        this.parentlistform.channelinfo[this.nIndex].Group = this.Group;
//        this.parentlistform.channelinfo[this.nIndex].Ystno = this.Ystno;
//    }
//}
